package com.example.zjsr.dao;

import com.example.zjsr.domain.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserDao {

    int checkLoginName(String loginName);

    int checkEmail(String email);

    int insert(User user);

    User checkLoginNameOrEmail(@Param("loginName") String loginName, @Param("email") String email);

    int updatePasswordByEmail(User user);

    List<User> selectAll(User user);

    int insertBackUser(User user);

    int deleteByUserId(Integer id);

    int deleteByUserId2(Integer id);

    int updateBackendUser(User user);

    List<User> selectByParams(User user);

    int selectUserCounts();

    User findById(Integer id);

    User findByLoginName(String loginName);

    int inserIlabUser(User user);

    List<FruitMapping> getFruitField();

    void expertLogin(User expertLoginUser);

    void deleteUser();

    int addPlatform(Platform platform);

    int deletePlatform(@Param("platformId") Integer platformId);

    int updatePlatform(Platform platform);

    List<Platform> getPlatform(@Param("platformId") Integer platformId);

    void addBroadcast(Broadcast broadcast);

    int addProjectDesign(List<ProjectDesign> projectDesignList);

    List<Broadcast> getBroadcast(@Param("id") Integer id);

    int addHeadline(Headline headline);

    List<Headline> getHeadline();

    int updateHeadline(Headline headline);

    int addTopic(Topic topic);

    int updateTopic(Topic topic);

    List<Topic> getTopic(@Param("headlineId") Integer headlineId);

    int addAnswer(List<Answer> answerList);

    Answer getAnswerStatus(@Param("answerId") Integer answerId);

    void updateAnswerStatus(@Param("topicId") Integer topicId);

    int updateAnswer(Answer answer);

    List<Answer> getAnswer(@Param("topicId") Integer topicId);

   List<Headline> getAllAnswer(@Param("headlineId") Integer headlineId);

    int deleteAnswers(@Param("answerId") Integer answerId);

    int deleteTopic(@Param("topicId") Integer topicId);

    void deleteAnswerByTopic(Integer topicId);

    int deleteHeadline(@Param("headlineId") Integer headlineId);

    void updateAnswerCheckStatus(@Param("answerId") Integer choose);

    Broadcast getBroadcastByUser(@Param("uId") Integer uId);

    void deleteProjectDesign(@Param("broadcastId") Integer broadcastId);

    void deleteBroadcast(@Param("broadcastId") Integer broadcastId);

    void insertOperate(Operate operate);

    User checkLogin(@Param("email") String email);

    List<Operate> getOperateInfo();

    List<DownOperate> downLoadOperateInfo();

    List<User> getUsers();

    void updateMD5Password(User user);

    List<ScoreQcVo> getScore(User user);

    Score getScoreById(@Param("scoreId") Integer scoreId);

    int deleteScoreById(@Param("scoreId") Integer scoreId);

    int readScoreById(@Param("scoreId") Integer scoreId,@Param("teacherComment") String teacherComment);

    void addScore(Score score);

    int accountExp();

    int countTotalExpTime();

    void updateuserCount(String loginName);

    int getUserCount(String loginName);

    Date getsdbegintime(String loginName);

    void getUserCount2(String loginName);

    void upDatePasswordTime(String loginName );

    void gettimepassword(String loginName);

    int getOnlyOne(String email);

    int getOnlyLoginname(String loginName);


    int getOnlyOne2(String email, Integer id);

    int getOnlyLoginname2(String loginName, Integer id);

    int addScoreBd(ScoreQc scoreQc);
}
